package com.zhang.crm.service.impl;

import com.zhang.crm.mapper.TTranHistorymapper;
import com.zhang.crm.pojo.TTranHistory;
import com.zhang.crm.service.TranHistoryService;
import com.zhang.crm.util.UserUtil;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;


@Service
public class TranHistoryServiceImpl implements TranHistoryService {

    @Resource
    private TTranHistorymapper tTranHistorymapper;
    @Override
    public Boolean addTranHistory(TTranHistory tTranHistory) {
        tTranHistory.setCreateBy(UserUtil.getUserInfo().getId());
        tTranHistory.setCreateTime(new Date());
        int insert = tTranHistorymapper.insert(tTranHistory);
        return insert > 0 ? true : false;
    }
}
